from django.conf.urls import url
from rest_framework_jwt.views import obtain_jwt_token

from . import views
urlpatterns=[
    url(r'^usernames/(?P<username>\w{5,20})/count/$',views.RegisterUsernameCountAPIView.as_view(),name='UsernameCount'),
    url(r'^phones/(?P<mobile>1[345789]\d{9})/count/$',views.RegisterPhoneCountAPIView.as_view(),name='MobileCount'),
    url(r'^$',views.RegisterCreateView.as_view(),name='Register'),
    # url(r'^auths/$',obtain_jwt_token,name='auths'),
    url(r'^auths/$',views.ObtainJsonWebTokenView.as_view() ,name='auths'),
    url(r'^infos/$',views.UserCenterInfoAPIView.as_view(),name='CenterInfo'),
    url(r'^emails/$',views.UserEmailAPIView.as_view(),name='UserEmail'),
    url(r'^emails/verification/$',views.UserEmailVerificationAPIView.as_view(),name='UserEmailVerification'),
    url(r'^addresses/$',views.AddressListView.as_view(),name='AddAddresses'),
    url(r'^addresses/(?P<pk>\d+)/$',views.AddressModifyView.as_view(),name='ModifyAddresses'),
    url(r'^addresses/(?P<pk>\d+)/status/$',views.SetDefaultAddressView.as_view(),name='DefaultAddresses'),
    url(r'^browerhistories/$',views.BrowerHistoryView.as_view(),name='browerhistory'),
    url(r'^(?P<user_id>.+)/password/$',views.Change_Password_Viwe.as_view()),
]